Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add $prepend and $append APIs to imports #124

Merged
merged 1 commit into from
Aug 27, 2024
Merged

feat: add $prepend and $append APIs to imports #124

merged 1 commit into from
Aug 27, 2024

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Aug 27, 2024

fix #122

Add $prepend and $append APIs to imports. Deprecate $add as it does the same as $prepend.

The test snapshot should show that $append will append after the last import now, and it creates a new line after the last import. I think that's recast behaviour as adding new properties to objects also tend to create new lines.

@antfu antfu merged commit d61c1f0 into unjs:main Aug 27, 2024
1 check passed
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.49%. Comparing base (46f6cee) to head (060b549).
Report is 8 commits behind head on main.

Files Patch % Lines
src/proxy/imports.ts 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   93.54%   93.49%   -0.05%     
==========================================
  Files          25       27       +2     
  Lines        1797     1876      +79     
  Branches      335      346      +11     
==========================================
+ Hits         1681     1754      +73     
- Misses        115      121       +6     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bluwy bluwy deleted the prepend-append-imports branch August 27, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow adding import statement after existing imports
2 participants